<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>015-查看属性权限.html</title>
</head>
<body>
	
</body>
<script>
	function Person(name,age){
		this.name = name;
		this.age = age;
	}
	Person.prototype.showName = function(){
		console.log("I am"+this.name);
	}
	Person.prototype.showAge = function(){
		console.log("I am"+this.age+"years old");
	}
	Person.prototype.LEGS =2;

	var p1 = new Person("chris",22);

	Object.defineProperties(p1,{
		LEGS:{
			value:2,
			enumerable:true,
			writable:true,
			configurable:true
		},
		HANDS:{
			value:2,
			enumerable:false,
			writable:true,
			configurable:true
		},
		MOUTH:{
			value:1,
			enumerable:true,
			writable:false,
			configurable:false
		}
	});
	console.log(Object.getOwnPropertyDescriptor(p1,"HANDS"));
	console.log(Object.getOwnPropertyDescriptor(p1,"name"));
	console.log(Object.getOwnPropertyDescriptor(p1,"LEGS"));
</script>
</html>